/**
 * @author yexy
 * @date 2020/6/2 12:24 上午
 * @description
 */
public class Module2Homework {
    public static void main(String[] args) {

       System.out.println("--------------------------------第1题------------------------------");
       Test1.show();
       System.out.println("--------------------------------第2题------------------------------");
       new Test2().beginGame();
       System.out.println("--------------------------------第3题------------------------------");
        test3();
    }

    private static void test3(){
        SIMCard simCard1 = new SIMCard(EnumSIMType.BIG,"11111111111","tom","123",110.1,121,"10G");
        SIMCard simCard2 = new SIMCard(EnumSIMType.NANO,"22222222222","sam","321",220.2,300,"12G");

        simCard1.show();
        simCard2.show();

        PhoneCombo combo1 = new PhoneCombo(300,100,88);
        NetCombo combo2 = new NetCombo(10,108);

        //套餐的show方法
        comboShow(combo1);
        comboShow(combo2);

        //接口调用
        callServiceShow(combo1,simCard1);
        NetServiceShow(combo2,simCard1);

    }

    private static void comboShow(Combo combo){
        System.out.println("---------------------抽象类多态---------------------");
        combo.show();
    }

    private static void callServiceShow(CallServiceInterface callServiceInterface,SIMCard simCard){
        System.out.println("---------------------接口多态---------------------");
        callServiceInterface.callShow(100,simCard);
    }

    private static void NetServiceShow(NetServiceInterface netServiceInterface,SIMCard simCard){
        System.out.println("---------------------接口多态---------------------");
        netServiceInterface.netShow(1000,simCard);
    }

}
